-
Notifications
You must be signed in to change notification settings - Fork 37
Allow generation of ParamsWithStats from FastLDF plus parameters, and also bundle_samples
#1129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Benchmark Report
Computer InformationBenchmark Results |
|
DynamicPPL.jl documentation for PR #1129 is available at: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## breaking #1129 +/- ##
============================================
- Coverage 81.67% 81.59% -0.09%
============================================
Files 42 42
Lines 3930 3955 +25
============================================
+ Hits 3210 3227 +17
- Misses 720 728 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c475f96 to
92cbb20
Compare
92cbb20 to
39df719
Compare
ParamsWithStats from FastLDF plus parametersParamsWithStats from FastLDF plus parameters, and also bundle_samples
3e646ca to
0dd2f70
Compare
0dd2f70 to
077457f
Compare
0150ef4 to
2fad97b
Compare
|
ping @sunxd3 :) |
sunxd3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, couple of tiny questions
| DynamicPPL.LogPriorAccumulator(), | ||
| DynamicPPL.LogLikelihoodAccumulator(), | ||
| DynamicPPL.ValuesAsInModelAccumulator(include_colon_eq), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am looking at
Lines 247 to 262 in 5d4527a
| """ | |
| fast_ldf_accs(getlogdensity::Function) | |
| Determine which accumulators are needed for fast evaluation with the given | |
| `getlogdensity` function. | |
| """ | |
| fast_ldf_accs(::Function) = default_accumulators() | |
| fast_ldf_accs(::typeof(getlogjoint_internal)) = default_accumulators() | |
| function fast_ldf_accs(::typeof(getlogjoint)) | |
| return AccumulatorTuple((LogPriorAccumulator(), LogLikelihoodAccumulator())) | |
| end | |
| function fast_ldf_accs(::typeof(getlogprior_internal)) | |
| return AccumulatorTuple((LogPriorAccumulator(), LogJacobianAccumulator())) | |
| end | |
| fast_ldf_accs(::typeof(getlogprior)) = AccumulatorTuple((LogPriorAccumulator(),)) | |
| fast_ldf_accs(::typeof(getloglikelihood)) = AccumulatorTuple((LogLikelihoodAccumulator(),)) |
LogJacobianAccumulator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, right. I think it doesn't matter for the present purposes because we always want the output to not include the Jacobian term i.e. logprior and logjoint are 'as seen in the model'.
This has no real impact on DynamicPPL, but using this in Turing should lead to some nice speedups because this:
unflatten+evaluate!!;Closes #1119.
Since the intention of this is to replace
Turing.Inference.TransitionwithParamsWithStats, I also added the necessaryAbstractMCMC.bundle_samplesmethod here. MCMCChainsExt is the natural place for it to live (it could be defined in Turing, but that would be piracy).